!!!

%html

  = render 'layouts/email_head'

  %body

    %table{:cellspacing => "0", :border => "0", :height => "100%", :bgcolor => "#ffffff", :cellpadding => "0", :width => "100%"}
      %tbody>
        %tr
          %td{:align => "center", :valign => "top"}
            %table{:cellspacing => "0", :cellpadding => "0", :width => "400"}
              %tbody
                - community = @community || @current_community
                - if community && community.wide_logo.present?
                  %tr
                    %td{align: "center"}
                      = image_tag community.wide_logo.url(:header), alt: community.full_name(I18n.locale), style: 'margin: 0 auto;'
                - if @community
                  %tr
                    %td{:align => "left", :style => "padding-top: 20px; padding-bottom: 5px; border-bottom:1px dotted grey;"}
                      %font{:size => 5, :color => "grey", :face => "font-family:Helvetica Neue, Arial, Helvetica, Arial, sans-serif;", :style => "font-size:20px;line-height:28px;"}
                        = @community.full_name(I18n.locale)
                - if @recipient && ! @no_recipient_name
                  %tr
                    %td{:align => "left", :style => "padding-top: 20px; padding-bottom: 10px;"}
                      %font{body_font}
                        = t("emails.common.hey", :name => PersonViewUtils.person_display_name_for_type(@recipient, "first_name_only"))


                %span{id: SecureRandom.hex}
                  = yield

                - if @show_branding_info
                  = render :partial => "layouts/email_non_whitelabel_branding", locals: {link_to_sharetribe: "https://www.sharetribe.com/?utm_source=#{@current_community.ident}.sharetribe.com&utm_medium=email&utm_campaign=nowl-emails-auto"}
                - @skip_unsubscribe_footer ||= false
                - if @recipient && @url_params && !@skip_unsubscribe_footer
                  %tr
                    %td{:align => "left",  :style => "padding-top: 10px; padding-bottom: 30px;border-top:1px dotted grey;"}
                      %font{:size => 3, :color => "gray", :face => "font-family:Helvetica Neue, Arial, Helvetica, Arial, sans-serif;", :style => "font-size:12px;"}
                        - if @community
                          = t("emails.common.unsubscribe_from_these_emails_info", service_name: @community.full_name(I18n.locale))
                        = t("emails.welcome_email.welcome_email_footer_text", :settings_link => link_to(t("emails.welcome_email.settings_link_text"), notifications_person_settings_url(@recipient, @url_params))).html_safe
                        - if @email_type
                          = t("emails.common.or")
                          = link_to(t("emails.common.unsubscribe_from_these_emails"), unsubscribe_person_settings_url(@recipient, @url_params.merge({email_type: @email_type, auth: @unsubscribe_token}))) + "."

                - if @invitation
                  %tr
                    %td{:align => "left",  :style => "padding-top: 10px; padding-bottom: 30px;border-top:1px dotted grey;"}
                      %font{:size => 3, :color => "gray", :face => "font-family:Helvetica Neue, Arial, Helvetica, Arial, sans-serif;", :style => "font-size:12px;"}
                        = t("emails.common.unsubscribe_from_invitation_emails_info", service_name: @invitation_community)
                        = link_to(t("emails.common.unsubscribe_from_invitation_emails", service_name: @invitation_community),
                          unsubscribe_invitations_url(@url_params)) + "."

